<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
window.onload=function(){
  var oTxt1=document.getElementById('txt1');
  var oTxt2=document.getElementById('txt2');
  var oBtn=document.getElementById('btn1');
  oBtn.onclick=function(){
   oTxt2.value+=oTxt1.value+'\n';//
   oTxt1.value='';
  };
    oTxt1.onkeydown=function(ev){
    var oEvent=ev||event;
    if(oEvent.keyCode==13 || oEvent.ctrlKey){//回车加ctrl键
        oTxt2.value+=oTxt1.value+'\n';//
        oTxt1.value='';
    }
  };
};
    </script>
</head>
<body>
<input type="text" id="txt1">
<input type="button" value="发布" id="btn1"><br>
<textarea name="" id="txt2" cols="30" rows="10"></textarea>
</body>
</html>